package com.Smart.smartscals.Fragment;

import java.util.ArrayList;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.Smart.smartscals.Activity.R;
import com.Smart.smartscals.CustomView.CustomCircleView;
import com.Smart.smartscals.CustomView.CustomDrawReportView;
import com.Smart.smartscals.CustomView.CustomViewChoiceTime;
import com.Smart.smartscals.Entity.EntityCircleView;
import com.Smart.smartscals.Utils.Tools;

public class FragmentMainReport extends BaseFragment {

	private CustomCircleView mCircleView1, mCircleView2, mCircleView3;
	private CustomViewChoiceTime mCustomViewChoiceTime;
	private CustomDrawReportView mCustomDrawReportView;// 绘制身体报表；
	private ArrayList<String> arrayListTv;
	private EntityCircleView mEntityCircleView;
	

	private CustomCircleView mCircleViewWeekWeight, mCircleViewWeekFat,
			mCircleViewGetWeightDays;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		mView = inflater.inflate(R.layout.fragment_main_report, null);
		return mView;
	}

	@Override
	public void onViewCreated(View view, Bundle savedInstanceState) {
		super.onViewCreated(view, savedInstanceState);
		initView();
		initParam();
		Tools.setLog("--->fragment:onViewCreated");
	}
	
	@Override
	public void onResume() {
		super.onResume();
		Tools.setLog("--->fragment:onResume");
	}
	

	private void initParam() {
		arrayListTv = new ArrayList<String>();
		arrayListTv.add("一");
		arrayListTv.add("二");
		arrayListTv.add("三");
		arrayListTv.add("四");

		arrayListTv.add("五");
		arrayListTv.add("六");
		arrayListTv.add("天");
		mCustomViewChoiceTime.startMytration(1);
		mCustomDrawReportView.statTration(arrayListTv);
		

	}

	private void initView() {
		mCustomViewChoiceTime = (CustomViewChoiceTime) mView
				.findViewById(R.id.main_report_customtimechoice);
		mCustomDrawReportView = (CustomDrawReportView) mView
				.findViewById(R.id.main_report_customreportview);
		mCircleViewWeekWeight = (CustomCircleView) mView
				.findViewById(R.id.main_report_customcircleview_1);
		mCircleViewWeekFat = (CustomCircleView) mView
				.findViewById(R.id.main_report_customcircleview_2);
		mCircleViewGetWeightDays = (CustomCircleView) mView
				.findViewById(R.id.main_report_customcircleview_3);

		mEntityCircleView = new EntityCircleView("0.0", "+", "kg", "本周体重");

		mCircleViewWeekWeight.initParam(mEntityCircleView);
//		mCircleViewWeekWeight.statAniMation();

		mCircleViewWeekFat.initParam(mEntityCircleView);
//		mCircleViewWeekFat.statAniMation();
		

		mCircleViewGetWeightDays.initParam(mEntityCircleView);
//		mCircleViewGetWeightDays.statAniMation();

	}
}
